:root {
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --accent-color: #60a5fa;
    --text-color: #1e293b;
    --background-color: #ffffff;
    --card-bg: #ffffff;
    --glow-color: rgba(37, 99, 235, 0.1);
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background-color);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 响应式字体大小 */
@media screen and (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

@media screen and (min-width: 1200px) {
    html {
        font-size: 18px;
    }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: clamp(1rem, 3vw, 1.5rem);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-content {
    width: min(1000px, 90%);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

header h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.timeline {
    width: min(600px, 90%);
    margin: clamp(8rem, 12vh, 10rem) auto 2rem;
    padding: 0 clamp(1rem, 3vw, 2rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.timeline-items {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
}

.timeline-item {
    width: 100%;
    position: relative;
    background: var(--card-bg);
    border-radius: clamp(12px, 2vw, 16px);
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* 添加卡片之间的分割线 */
.timeline-item::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--border-color),
        transparent
    );
}

/* 最后一个卡片不需要分割线 */
.timeline-item:last-child::after {
    display: none;
}

/* 添加卡片悬浮效果 */
.timeline-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.1);
    border-color: var(--primary-color);
}

/* 添加卡片内容区域的分割 */
.timeline-content {
    padding: clamp(1.5rem, 4vw, 2rem);
    position: relative;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

/* 优化卡片封面图区域 */
.timeline-cover {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-color);
}

.timeline-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.timeline-item:hover .timeline-cover img {
    transform: scale(1.05);
}

/* 添加卡片日期标签样式 */
.timeline-date {
    position: absolute;
    top: -3rem;
    right: 0;
    background: var(--primary-color);
    color: white;
    padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 3vw, 1.5rem);
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 500;
    border-bottom-left-radius: clamp(12px, 2vw, 16px);
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
}

.timeline-content h2 {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    margin: clamp(1rem, 3vw, 1.5rem) 0;
    color: var(--text-color);
    font-weight: 700;
}

.timeline-content p {
    color: #64748b;
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.8;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
}

.resource-link {
    display: inline-flex;
    align-items: center;
    padding: clamp(0.75rem, 2vw, 0.875rem) clamp(1.5rem, 3vw, 1.75rem);
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: clamp(6px, 1.5vw, 8px);
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.resource-link:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.resource-link::after {
    content: '→';
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.resource-link:hover::after {
    transform: translateX(4px);
}

footer {
    background: white;
    padding: clamp(1.5rem, 4vw, 2rem);
    text-align: center;
    margin-top: clamp(3rem, 6vw, 4rem);
    border-top: 1px solid var(--border-color);
    color: #64748b;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

/* 响应式布局断点 */
@media screen and (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1rem;
    }

    .timeline {
        width: 95%;
        margin-top: clamp(8rem, 15vh, 10rem);
    }

    .timeline-item {
        margin-bottom: 1rem;
    }

    .timeline-cover {
        padding-bottom: 66.67%; /* 3:2 宽高比，在移动端更适合 */
    }
    
    .timeline-date {
        top: -2.5rem;
    }

    .timeline-items {
        gap: 1.5rem;
    }

    .timeline-item::after {
        bottom: -0.75rem;
        width: 90%;
    }

    .timeline-content {
        padding: 1.25rem;
    }

    .header-nav {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .nav-buttons {
        display: flex;
        gap: 0.75rem;
        width: 100%;
        justify-content: flex-end;
    }

    .nav-link,
    .login-btn,
    .contact-btn {
        white-space: nowrap;
        min-width: fit-content;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .contact-btn span {
        display: inline-block;
        white-space: nowrap;
    }
}

/* 大屏幕优化 */
@media screen and (min-width: 1200px) {
    .timeline {
        max-width: 800px;
    }
}

/* 添加动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-item {
    animation: fadeIn 0.6s ease-out forwards;
}

.timeline-item:nth-child(2) {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(3) {
    animation-delay: 0.4s;
}

/* 打印样式优化 */
@media print {
    body {
        background: white;
    }
    
    .timeline-item {
        break-inside: avoid;
        border: 1px solid #ddd;
    }
    
    .resource-link {
        display: none;
    }
}

/* 添加图片加载动画 */
@keyframes imageLoad {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.timeline-cover img {
    animation: imageLoad 0.6s ease-out forwards;
}

/* 添加图片加载占位效果 */
.timeline-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* 图片加载完成后移除占位效果 */
.timeline-cover img.loaded + .timeline-cover::before {
    display: none;
}

/* 优化图片加载性能 */
.timeline-cover img {
    will-change: transform;
    backface-visibility: hidden;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    padding: 1rem;
    width: 100%;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-number,
.pagination-prev,
.pagination-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-number:hover,
.pagination-prev:hover,
.pagination-next:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-number.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-prev,
.pagination-next {
    background: var(--card-bg);
}

.pagination-prev:disabled,
.pagination-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
}

.pagination-ellipsis {
    color: var(--text-color);
    padding: 0 0.5rem;
}

/* 分页动画效果 */
@keyframes pageChange {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-items {
    animation: pageChange 0.3s ease-out;
}

/* 响应式分页 */
@media screen and (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pagination-numbers {
        order: 2;
        width: 100%;
        justify-content: center;
        margin: 0.5rem 0;
    }

    .pagination-prev,
    .pagination-next {
        order: 1;
        flex: 1;
    }

    .pagination-number {
        min-width: 2rem;
        height: 2rem;
        padding: 0 0.5rem;
    }
}

/* 添加分页切换效果 */
.timeline-items {
    position: relative;
}

.timeline-items.page-transition {
    animation: pageChange 0.3s ease-out;
}

/* 优化分页按钮触摸区域 */
@media (hover: none) {
    .pagination-number,
    .pagination-prev,
    .pagination-next {
        min-width: 3rem;
        height: 3rem;
    }
}

/* 添加分页加载状态 */
.pagination-loading {
    position: relative;
    pointer-events: none;
}

.pagination-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.pagination-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 1;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* 添加卡片加载动画 */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-item {
    animation: cardAppear 0.6s ease-out forwards;
}

/* 优化卡片间距和分割效果 */
.timeline-item + .timeline-item {
    margin-top: 0.5rem;
}

/* 添加卡片内容区域的分割线 */
.timeline-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--border-color),
        transparent
    );
}

/* 优化卡片阴影效果 */
.timeline-item {
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

.timeline-item:hover {
    box-shadow: 
        0 12px 24px rgba(37, 99, 235, 0.1),
        0 4px 8px rgba(37, 99, 235, 0.05);
}

/* 添加卡片内容区域的分割效果 */
.timeline-content h2 {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

/* 优化移动端显示 */
@media screen and (max-width: 480px) {
    .timeline {
        width: 95%;
        margin-top: clamp(7rem, 12vh, 9rem);
    }

    .timeline-items {
        gap: 1rem;
    }

    .timeline-item::after {
        bottom: -0.5rem;
        width: 95%;
    }

    .timeline-content {
        padding: 1rem;
    }
}

/* 导航栏样式 */
.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    margin-left: 2rem;
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

/* 联系我们按钮样式 */
.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, var(--secondary-color), var(--primary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.contact-btn:hover::before {
    opacity: 1;
}

.contact-btn span {
    position: relative;
    z-index: 1;
}

.contact-icon {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.contact-btn:hover .contact-icon {
    transform: translateY(-2px);
}

/* 添加按钮点击效果 */
.contact-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* 添加按钮动画效果 */
@keyframes buttonPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.contact-btn {
    animation: buttonPulse 2s infinite;
}

/* 优化按钮可访问性 */
.contact-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.contact-btn:focus:not(:focus-visible) {
    box-shadow: none;
}

/* 添加按钮加载状态 */
.contact-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.contact-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* 导航链接样式 */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.nav-link:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

/* 当前页面按钮样式 */
.contact-btn.active {
    background: var(--secondary-color);
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .header-nav {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        margin-left: 0;
    }

    .nav-buttons {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .nav-link,
    .contact-btn {
        width: 100%;
        justify-content: center;
    }
}

.header-nav .login-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.header-nav .login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, var(--secondary-color), var(--primary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.header-nav .login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.header-nav .login-btn:hover::before {
    opacity: 1;
}

.header-nav .login-btn span {
    position: relative;
    z-index: 1;
}

.header-nav .login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* 添加按钮动画效果 */
@keyframes buttonPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.header-nav .login-btn {
    animation: buttonPulse 2s infinite;
}

.search-container {
    position: relative;
    margin: 0;
}

.search-input {
    width: 240px;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    width: 280px;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #64748b;
    pointer-events: none;
}

.search-input:focus + .search-icon {
    color: var(--primary-color);
}

@media screen and (max-width: 768px) {
    .header-nav {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        margin-left: 0;
    }

    .nav-buttons {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .search-container {
        width: 100%;
        margin: 0.5rem 0;
    }

    .search-input {
        width: 100%;
    }

    .search-input:focus {
        width: 100%;
    }
}

/* 资源描述样式 */
.resource-description {
    color: #64748b;
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.8;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 5.4em; /* 3行文字的高度 */
}
